Getting a Theme
For getting the theme of Python, kindly go through my previous article,
Introduction
In this second part we will learn about Python and several other programming languages. We will compare several programming languages with Python using some basis concepts and examples.
So let's explore them, one by one.
Python VS Java
- As we know, time complexity is directly proportional to space. On behalf of this we can compare both Python and Java. A Python snippet runs much slower compared to Java snippets.
- Python snippets take very less memory compared to Java. That's why the space complexity of Python is better than Java.
- Python snippets require much effort compared to Java.
- Python snippets, for a specific functionality, requires less lines or statements compared to to Java.
- Python snippets are 3-5 times shorter than a Java snippet for the same functionality.
- Java is categorized as a low-level implementation language whereas Python is a high-level or glue type language.
Example
Snippet | Python
Snippet | Java
- public class GoodByeWorld {
- public static void main(String[] args)
- {
- System.out.println("GoodBye World!");
- }
-
- }
Output
GoodBye World
Python VS C++
- Python snippets are comparatively 5-10 times shorter than a C++ snippets for the same functionality.
- Python is a high-level language and C++ is low-level.
- Python acts as a glue language to combine components written in C++.
- Python provides much flexibility in calling functions and returing values in comparision to C++.
- C++ snippets work faster than Python.
- Python is interpreated whereas C++ is a compiled.
- Python uses Garbage Collection whereas C++ doesn't.
Example
Snippet | Python
Snippet | C++
- #include <iostream>
- void main()
- {
- cout << "GoodBye World!";
- }
Output
GoodBye World
Python VS Perl
- Perl emphasizes support for Common Application oriented tasks (for example, file scanning, report generation and so on) whereas Python emphasizes support for Common Programming Methodologies (for example, Data Structure Design, OOP concepts and so on).
- Python is much more maintainable and reuable than a Perl Snippet.
- Python is a high-level language whereas Perl is middle-level.
Example
Snippet | Python
Snippet | Perl
Output
GoodBye World
Python VS JavaScript
- JavaScript is all about classes whereas Python deals simply with functions and variables without getting entangled in class definitions.
- Python provides better code reusability than JavaScript.
- Pyhton is better in scalability and maintainability.
- Python is a high-level language whereas JavaScript is low-level.
Example
Snippet | Python
Snippet | JavaScript
- <html>
- <head></head>
- <body>
- <script>
- alert('GoodBye, World!')
- </script>
- </body>
- </html>
Output
GoodBye World
Python VS TCL
- Python is a rich programming language when we talk about data structures whereas TCL traditionally stores all data as a string.
- The space complexity of a Python snippet is much less than of TCL.
- For extended functionality or high-level development, TCL lacks features (modular namespaces). That's why TCL usually contains TCL extensions written in C whereas Python is stand-alone and sufficient for any type of functionality and doesn't require extensibility in any other language.
Example
Snippet | Python
Snippet | TCL
- $ vim GoodByeWorld.tcl
- puts "GoodBye World!"
Output
GoodBye World
Python VS Smalltalk
- Python contains dynamic binding and dynamic typing whereass Smalltalk lacks both, however it is also an object oriented language (the first object oriented language).
- Python contains a rich library. It has more features for dealing with the internet, the web such as www, FTP and so on whereas Smalltalk's standard library of collection data types are refined.
- Smalltalk follows a monolithic approach whereas Python has a different and separate development and environment distribution of code.
Example
Snippet | Python
Snippet | Smalltalk
- #include <stdio.h>
- void main()
- {
- printf("GoodBye World");
- }
Output
GoodBye World!
Python VS PHP
- Python is much more maintainable than PHP.
- Pyhton snippets execute much faster than PHP (95% faster).
- Python is better than PHP whenever we talk about developing better scalable applications.
- Pyhton is much more stable and upward compatible than PHP.
- Python is an object oriented language whereas PHP is structure based.
- The space complexity of Python is much less than Python.
Example
Snippet | Python
Snippet | PHP
- <html>
- <head>
- <title>PHP Test</title>
- </head>
- <body>
- <?php echo '
- <p> GoodBye World!</p>'; ?>
- </body>
- </html>
Output
GoodBye World!
Guidelines from my Side
- Do as much code as you can.
- Code anything you want, that is the best way to learn.
- Don't just study things, try to learn them.
- Work on your concepts.
- Work on the fundamentals of any technology or stuff you want to learn.
Moto
“Keep calm and code Python”.
I tried to make it interesting and an interactive article and I wish you guys will like that, meanwhile if you have any suggestions then your welcome.
Until the next part, keep sharing.